export default function (point,text,myMap) {

const ComplexCustomOverlay = function(point, text) {
    this._point = point;
    this._text = text;
}

ComplexCustomOverlay.prototype = new BMap.Overlay();

ComplexCustomOverlay.prototype.initialize = function (map) {
    this._map = map;
    var div = this._div = document.createElement("div");
    div.style.position = "absolute";
    div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
    div.style.background = "linear-gradient(180deg, #0E2E5F 1%, #2A5391 100%)";
    div.style.border = "2px solid #D3EAFF";
    div.style.color = "#fff";
    div.style.padding = "20px 60px";
    div.style.whiteSpace = "nowrap";
    div.style.MozUserSelect = "none";
    div.style.fontSize = "30px"
    div.style.borderRadius = "70px"
    div.style.boxShadow = "inset 0px -19px 20px 0px rgba(159,209,255,0.4)"
    div.style.opacity = 1

    var span = this._span = document.createElement("span");
    div.appendChild(span);
    span.appendChild(document.createTextNode(this._text));

    myMap.getPanes().labelPane.appendChild(div);

    return div;
}

    
ComplexCustomOverlay.prototype.draw = function () {
    var map = this._map;
    var pixel = map.pointToOverlayPixel(this._point);
    this._div.style.left = pixel.x - 35 + "px"; //控制这个信息窗口针对标注物原点的偏移量，这也是前面div要设置样式position:absolute;
    this._div.style.top = pixel.y - 70 + "px";
}

return new ComplexCustomOverlay(point,text)
}